package dominion.model.actions.base;

import java.util.List;

import dominion.model.Card;
import dominion.model.Deck;
import dominion.model.GameBoard;
import dominion.model.Player;
import dominion.model.actions.Action;
import dominion.utils.Constants;

public class Chancellor extends Action {

	public Chancellor() {
		cost = 3;
	}

	@Override
	public Card clone() {
		return new Chancellor();
	}

	@Override
	public String toString() {
		return "Chancellor";
	}

	@Override
	public String getDescription() {
		StringBuffer sb = new StringBuffer();
		sb.append(super.getDescription());
		sb.append("+$2\n");
		sb.append("You may immediately put your deck into your discard pile\n");
		return sb.toString();
	}

	@Override
	public void doAction(Player player, GameBoard board, List<Player> players) {
		player.changeAction(-1);
		player.changeMoney(2);
		playedCard(player);

		Deck lib = player.getLib();
		List<Card> cards = lib.drawCards(lib.size());
		player.addToDeck(cards, Constants.DISCARD_DECK);
	}
}
